package com.zhijiaoyun.controller;

import com.zhijiaoyun.common.DsConstant;
import com.zhijiaoyun.controller.base.BaseController;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.Map;

/**
 * @author shisfish
 * @date 2018/1/18
 */
@Controller
@RequestMapping(value = "/system", produces = "application/json; chraset=utf-8")
public class SystemController extends BaseController {

    @ResponseBody
    @RequestMapping(value = "/{type}/export-excel")
    public Map<String, Object> exportExcel(@PathVariable String type) {
        String filePath = null;
        if (DsConstant.EXCEL_TYPE_USER.equals(type)) {
            filePath = excelService.exportUser();
        }
        Map<String, Object> map = new HashMap<>();
        map.put("excelPath", filePath);
        return responseSuccessMap(map);
    }

}
